//
//  ReportViewController.m
//  OutesIOS
//
//  Created by norman on 2019/1/13.
//  Copyright © 2019 norman. All rights reserved.
//

#import "ReportViewController.h"

@interface ReportViewController ()

@property (nonatomic,strong) UIWebView *webView;

@end

@implementation ReportViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupViews];
    //[self loadWebData];
    // Do any additional setup after loading the view.
}


#pragma mark - 初始化视图
- (void)setupViews{
    self.webView = [[UIWebView alloc] initWithFrame:kScreen_Bounds];
    self.webView.height -= kStatus_Navigation_Height;
    if (iPhone_X) {
        self.webView.height -= KIphoneX_Adjust_Height;
    }
    self.webView.delegate = self;
    
    self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
    self.webView.scalesPageToFit = YES;
    self.webView.multipleTouchEnabled = YES;
    self.webView.userInteractionEnabled = YES;
    
    NSURLRequest *request =[NSURLRequest requestWithURL:self.url];
    [self.view addSubview: self.webView];
    [MBProgressHUD showMessage:@"数据加载中..." toView:self.view];
    [self.webView loadRequest:request];
}

- (void)webViewDidStartLoad:(UIWebView *)webView {
    
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    [MBProgressHUD hideHUDForView:self.view];
    
//    NSString *javascript = [NSString stringWithFormat:@"var viewPortTag=document.createElement('meta');  \
//                            viewPortTag.id='viewport';  \
//                            viewPortTag.name = 'viewport';  \
//                            viewPortTag.content = 'width=%d; initial-scale=%f; minimum-scale=0.2; maximum-scale=2.0; user-scalable=yes;';  \
//                            document.getElementsByTagName('head')[0].appendChild(viewPortTag);" , (int)webView.bounds.size.width, self.rate];
//    
//    [webView stringByEvaluatingJavaScriptFromString:javascript];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
